#pragma once

#include "NeroCore\NAudioFramework.h"
#include <vector>

namespace Engine
{
enum AudioAction
{
	AudioAction_None = 0,
	AudioAction_Play,
	AudioAction_Pause,
	AudioAction_Stop,
	AudioAction_Remove,
	//Count
	AudioState_Count
};

struct AudioEvent
{
	ALuint Source;
	ALuint Buffer;
	AudioAction Action;
	std::string file;
};

class NAudioManager
{
private:
	typedef std::vector<AudioEvent> AudioSources;

public:
	NAudioManager(void);
	
	virtual ~NAudioManager(void);
	
	void TurnOnAudioSystem();

	void ShutDownAudioSystem();

	static void Initialize();

	static void Deinitialize();

	static NAudioManager* GetInstance();

	void PlaySFX(const char* file);

	void Update(float deltaTime);

	void LoadAudio(const char* file);

private:
	void DestroyAudioEvent(AudioEvent aEvent);

private:
	static NAudioManager* sInstance;
	AudioSources mAudioSourceList;	
};
}